<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
/* 
修改this的指针:
1.函数名.call(对象);
2.函数名.apply(对象);
3.bind();
 */
var Student={
  name:"jason",
  like:function(){
   console.log(this);
   console.log(this.name+"钓鱼");
  }
}
//Student.like();//this指向Student对象
var fn=Student.like;
fn();//this指向window
console.log(window.fn===fn);//true
//改变this的指针
var teacher={
  name:"老王",
}
//call;
//fn.call(teacher);
fn.apply(teacher)
  </script>
</head>
<body>
  
</body>
</html>